<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Rendering</title>
    <link rel="stylesheet" href="./css/Home.css">
    <style>
    *{
        margin:0;padding:0;
    }
    a{
        text-decoration:none;
    }
    li{
        list-style:none;
    }
    #banner{
        position:relative;height:537px;overflow: hidden;
    }
    #banner .banner_img{
        position:relative;width:400%;height:537px;overflow:hidden;
    }
    #banner .banner_img .banner_ul{
    position:relative;height:537px;overflow:hidden;
    }
    #banner .banner_img .banner_ul li{
    
        height:537px;float:left;left:100%;width:25%;
    }
    #banner .banner_img .banner_ul img{
        width:100%;height:537px;
    }
    #banner .banner-span{
        position:absolute;bottom:10px;left:50%;
        
    }
    #banner .banner-span span{
        width:10px;float:left;height:10px;border-radius:50%;border:1px solid black;	margin-right:15px;bottom:10px;left:45%;cursor:pointer;
    }
    #banner .banner-span .span_point{
        background:rgba(255, 255, 255, .3);
    }
    #banner .banner_a{
        position:absolute;	top:50%; width:100%;height:40px;margin:0 10px;font-size:30px;
    }
    #banner .banner_a .banner_prev{
        position:absolute;left:10px;background:rgbargba(255, 255, 255, .3);cursor:pointer;
    }
    #banner .banner_a .banner_next{
        position:absolute;right:30px;background:rgba(255, 255, 255, .3);cursor:pointer;
    }
    
    </style>
    <style>
        * {
            margin: 0;
        } 
        .block {
            position: relative;
            width: 65%;
            margin: 0 auto;
            border: 1px solid white;
        }
 
        .bchild {
            position: absolute;
            float: left;
            width: 200px;
            background-color: white;
            border-radius: 5px;
            box-shadow: 0 0 10px silver;
            margin: 0 5px;
        }
 
        .imglist {
            width: 180px;
            margin: 10px 10px;
        }
    </style>
</head>
<body>
    <div class="nav">
        <div class="nav-warp">
            <div class="nav-left">
                <img src="./img/shininglogo.png">
            </div>
            <div class="nav-right">
                <a href="Home.html" class="home">Home</a>
                <a href="./About.html">About</a>
                <a href="Rendering.html">Rendering</a>
                <a href="3DAnimation.html">3D&nbsp;Animation</a>
                <a href="Bim.html">Bim</a>
                <a href="Contact.html">Contact</a>
                <span><img src="./img/nav.png"/></span>
            </div>
        </div>
    </div>
    <div id="banner">
        <div class="banner_img">
            <ul class="banner_ul">
                    <li><img src="./img/Banner (1).jpg"/></li>
                    <li><img src="./img/Banner (2).jpg"/></li>
                    <li><img src="./img/Banner (3).jpg"/></li>
            </ul>
        </div>
        <nav class="banner-span">
            <span class="span_point"></span>
            <span></span>
            <span></span>
        </nav>
        <div class="banner_a">
            <div class="banner_prev"> &lt; </div>
            <div class="banner_next"> &gt; </div>
        </div>
    </div>
    <div class="block">
    </div>
    <!-- <div class="wrap">
        <div class="image-item"><img src="./img/1.jpg" class="image"></div>
        <div class="image-item"><img src="./img/2.jpg" class="image"></div>
        <div class="image-item"><img src="./img/3.jpg" class="image"></div>
        <div class="image-item"><img src="./img/4.jpg" class="image"></div>
        <div class="image-item"><img src="./img/5.jpg" class="image"></div>
        <div class="image-item"><img src="./img/6.jpg" class="image"></div>
        <div class="image-item"><img src="./img/7.jpg" class="image"></div>
        <div class="image-item"><img src="./img/8.jpg" class="image"></div>
        <div class="image-item"><img src="./img/9.jpg" class="image"></div>
        <div class="image-item"><img src="./img/10.jpg" class="image"></div>
        <div class="image-item"><img src="./img/11.jpg" class="image"></div>
        <div class="image-item"><img src="./img/12.jpg" class="image"></div>
        <div class="image-item"><img src="./img/13.jpg" class="image"></div>
        <div class="image-item"><img src="./img/14.jpg" class="image"></div>
        <div class="image-item"><img src="./img/15.jpg" class="image"></div>
        <div class="image-item"><img src="./img/16.jpg" class="image"></div>
        <div class="image-item"><img src="./img/17.jpg" class="image"></div>
        <div class="image-item"><img src="./img/18.jpg" class="image"></div>
    </div> -->
    <div class="footer">
        <div class="footer-img">
            <a class="img-top">
                <img src="./img/mail_h.jpg">
                <img src="./img/mail.jpg" id="img1">
            </a>
        </div>
        <div class="footer-bottom">
            <a class="img-bottom1">
                <img src="./img/facebook_h.jpg">
                <img src="./img/facebook.jpg" id="img2">
            </a>
            <a class="img-bottom1">
                <img src="./img/youtube_h.jpg">
                <img src="./img/youtube.jpg" id="img3">
            </a>
            <a class="img-bottom1">
                <img src="./img/linkedln_h.jpg">
                <img src="./img/linkedln.jpg" id="img4">
            </a>
            <a class="img-bottom1">
                <img src="./img/twitter_h.jpg">
                <img src="./img/twitter.jpg" id="img5">
            </a>
        </div>
        <div class="footer-txt">
            <h6>版权所有©1998-2015光明集团</h6>
        </div>
    </div>
</body>
<script src="http://libs.baidu.com/jquery/2.1.4/jquery.min.js"></script>
<script>
    $(function(){
        var timer = setInterval(autoPlay,6000);
        var iNow = 0;
        var iX = $(".banner_ul li").width();
        var iL = $(".banner_ul").children();

        console.log(iL.length);
        //自动播放
        function autoPlay(){
            iNow++;
            if(iNow>=iL.length){
                $(".banner_ul").css('left',0);
                iNow = 0;
            }
            $(".banner_ul").animate({left:-iX*iNow},3000);
            $(".banner-span span").removeClass("span_point");
            $(".banner-span span").eq(iNow).addClass("span_point");
        }

        //鼠标移动事件  //清除定时器

        $(".banner").hover(function(){
            clearInterval(timer);
            $(".banner_prev").show();
            $(".banner_next").show();
        },function(){
            timer = setInterval(autoPlay,3000);
            $(".banner_prev").hide();
            $(".banner_next").hide();
        })

        
        //鼠标点击事件（左右）
        //右点击
        $(".banner_next").click(function(){
            clearInterval(timer);
            iNow++;
            if(iNow>=iL.length){
                $(".banner_ul").css('left','0');
                iNow = 0;
            }
            $(".banner_ul").css("left",-iNow*iX);
            $(".banner-span span").removeClass("span_point");
            $(".banner-span span").eq(iNow).addClass("span_point");
        })
        //左点击
        $(".banner_prev").click(function(){
            clearInterval(timer);
            --iNow;
            if(iNow<=-1){
                $(".banner_ul").css("left",-(iL.length-1)*iX);
                iNow = iL.length-1;
            }
            $(".banner_ul").css("left",-iNow*iX);
            $(".banner-span span").removeClass("span_point");
            $(".banner-span span").eq(iNow).addClass("span_point");
        });

        //图标点击事件
        $(".banner-span span").click(function(){
            clearInterval(timer);
            $(".banner-span span").removeClass("span_point");
            $(".banner-span span").eq($(this).index()).addClass("span_point");
            iNow= $(this).index();
            $(".banner_ul").css("left",-iNow*iX);
        })

    })
</script>
<script src="js/jquery-3.3.1.min.js"></script>
<!-- <script>
    const config = {
        mode: 0,
        marginHeight: 20,
    }

    window.onload = function() {
        init();
    }

    function init() {
        let {mode} = config;
        config.imagesArray = document.querySelectorAll(".image-item");

        const windowWidth = document.querySelector(".wrap").getBoundingClientRect().width; // 容器宽度
        const imageWidth =  config.imagesArray[0].getBoundingClientRect().width; // 单张图片宽度
        config.imageWidth = imageWidth;
        config.cols = parseInt(windowWidth/imageWidth); // 计算列数
        //计算图片之间的间距(可选择space-between/space-around)
        let spanNum = mode ? config.cols -1 : config.cols +1;
        config.margin = (windowWidth - imageWidth * config.cols) / spanNum;
        
        config.heightArray = (new Array(config.cols)).fill(0,0); //得到初始高度的数组

        setImagePos();
    }

    function setImagePos() {
        let { imageWidth, imagesArray, margin, heightArray, mode } = config;
        imagesArray.forEach(item => {
            //取高度数组中的最小值
            let minHeight = Math.min.apply(Math.min, heightArray);
            let currentIndex = heightArray.indexOf(minHeight);
            // 设置图片位置
            item.style.top = minHeight + "px";
            if(mode) {
                item.style.left = currentIndex * (imageWidth + margin) + "px";
            } else {
                item.style.left = currentIndex * (imageWidth + margin) + margin + "px";
            }
            

            //更新高度数组
            let newHeight = item.getBoundingClientRect().height + config.marginHeight;
            heightArray[currentIndex] += newHeight;
        });
    }

    let timer;
    window.onresize = function() {
        clearTimeout(timer);
        timer = setTimeout(init, 50);
    }
    </script> -->
<!-- ?? -->
<script>
    var list = ["1.jpg", "2.jpg", "3.jpg", "4.jpg", "5.jpg", "6.jpg", "7.jpg", "8.jpg", "9.jpg", "10.jpg", "11.jpg", "12.jpg", "13.jpg", "14.jpg", "15.jpg", "16.jpg", "17.jpg", "18.jpg"];
    showImage(list);
    $(document).bind("scroll", function () {
        if ($(window).height() + $(this).scrollTop() >= $(document).height() - 700) {
            var newlist = [list[Math.floor(Math.random() * list.length)], list[Math.floor(Math.random() * list.length)], list[Math.floor(Math.random() * list.length)], list[Math.floor(Math.random() * list.length)]];
            showImage(newlist);
        }
    });
    function showImage(obj) {
        //创建元素的
        obj.forEach(function (res, index) {
            var bo = $("<div class='bchild'></div>");
            var img = $("<img class='imglist'>");
            img.attr("src", "./img/" + res);
            bo.append(img);
            $(".block").append(bo);
        });
        //遍历了所有  容器
        $(".bchild").each(function (index) {
            if (index < 4) {
                $(".bchild").eq(index).css("top", 10);
            }
            else {
                $(".bchild").eq(index).css({
                    "top": $(".bchild").eq(index - 4)[0].offsetHeight + $(".bchild").eq(index - 4)[0].offsetTop + 10
                });
            }
            $(".bchild").eq(index).css("left", index % 4 * 210);
        });
        $(".block").css("height", "1000px");
    }
</script>
</html>